#pragma once

#include "sound.h"
#include "graphics.h"
#include "control.h"
#include "gamemodel.h"
#include "resourcemanager.h"
#include "levelloader.h"
#include "enemy.h"
#include <ClanLib/application.h>
#include <ClanLib/core.h>
#include <ClanLib/display.h>
#include <ClanLib/gl.h>
#include <ClanLib/sound.h>
#include <ClanLib/vorbis.h>
#include <vector>

#ifdef WIN32
#include <windows.h>
#define UNISLEEP(x) Sleep(x)
#else
#include <unistd.h>
#define UNISLEEP(x) usleep(x)
#endif

// engine in der die mainloop laeuft

class Engine {
public:
	Engine(void);
	~Engine(void);
	void start();
	void end();
private:
	Graphics* graphicEngine;
	Sound* soundEngine;
	Control* controls;
	GameModel* model;
	ResourceManager* resourceManager;

	CL_ConsoleWindow* console;
	CL_DisplayWindow* window;

	void loadImages();
	void loadLevel();
	void mainloop();

};
